<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>创客签到系统后台</title>
    <link rel="stylesheet" href="../../static/style/css/bootstrap.css">
    <link rel="stylesheet" href="../../static/style/css/font-awesome.css">
    <script src="../../static/style/js/jquery.js"></script>
    <script src="../../static/style/js/jquery.jedate.js"></script>
    <script src="../../static/style/js/bootstrap.js"></script>
    <script src="../../static/style/js/wangEditor.min.js"></script>
    <script src="/static/style/js/location.js"></script>

    <script type="text/javascript" src="../../static/style/js/honeySwitch.js"></script>
    <script type="text/javascript" src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>

    <link rel="stylesheet" href="../../static/style/admin/css/header.css">
    <link rel="stylesheet" href="../../static/style/admin/css/admin.css">
    <link rel="stylesheet" href="../../static/style/css/all-style.css">
    <link rel="stylesheet" href="../../static/style/js/skin/jedate.css">
    <link rel="stylesheet" href="/static/style/css/honeySwitch.css">
</head>
<body>
	<header class="header">
		<div class="h-logo">
			<span class="fa fa-navicon"></span>
			<span>创客考勤系统</span>
		</div>
		<div class="pull-right">
			<a id="logout" href="javascript:;" class="btn btn-xs btn-danger">
                <span class="fa fa-sign-out"></span> 注销
            </a>
		</div>
	</header>

	<aside class="side">
		<div>
			<a href="/admin"><img class="img-circle" src="../../static/images/logo.png" width="60"></a>
			<h5><b>欢迎: {{ name }}</b></h5>
		</div>
        <ul id="aside-menu">
            <li>
                <a href="/admin"><span class="fa fa-dashboard"></span>仪表盘</a>
            </li>
            <li>
                <a href="/admin/online"><span class="fa fa-hand-o-down"></span>在线签到</a>
            </li>
            <li>
                <a href="/admin/plan"><span class="fa fa-book"></span>授课计划</a>
            </li>
            <li>
                <a href="/admin/record"><span class="fa fa-file-text-o"></span>考勤记录</a>  <!-- 分类：学生 是否缺勤 课程 -->
            </li>
            <li>
                <a href="/admin/work"><span class="fa fa-pencil"></span>作业管理</a> <!-- 学生 课程 状态 -->
            </li>
            <li>
                <a href="/admin/z_study"><span class="fa fa-file-archive-o"></span>自习记录</a>
            </li>
            <li>
                <a href="/admin/student"><span class="fa fa-male"></span> 学员管理</a>
            </li>
            {% if name == 'admin' %}
                <li id="menu">
                    <a href="javascript:"><span class="fa fa-cog"></span>系统管理</a>
                    <ul class="hide-opt">
                        <li><a href="/admin/list">管理员信息</a></li>
                        <li><a href="/admin/add">添加管理员</a></li>
                        <li><a href="/admin/change">个人设置</a></li>
                        <li><a href="/admin/input_location">位置管理</a></li>
                    </ul>
                </li>
            {% else %}
                <li><a href="/admin/change"><span class="fa fa-cog"></span>个人设置</a></li>
            {% endif %}
        </ul>
	</aside>
	
	<script type="text/javascript">
		// 通过jquery实现简洁的手风琴菜单
		$('#aside-menu #menu > a').on('click', function(event) {
			$(this).parent('li').siblings('li#menu').children('ul').hide(300); // 隐藏其他的菜单
			$(this).parent('li').children('ul').toggle(300); // 显示当前菜单
		});
		// 侧边栏显隐
{#		$('.h-logo > span:first-child').click(function(event) {#}
{#			var SW = parseInt($('.side').outerWidth());#}
{#			if (SW > 200) {#}
{#				$('.side').css('width', '0');#}
{#				$('[class$="xcontent"]').css('padding-left', '5px');#}
{#			} else {#}
{#				$('.side').css('width', '210px');#}
{#				$('[class$="xcontent"]').css('padding-left', '215px');#}
{#			}#}
{#		});#}
		
		function changeTab(text) {
			// 通过a标签中内容改变菜单栏的激活
			$('.side li.active').removeClass('active'); // 将其他菜单去除激活
			$('.side li > a').each(function(index, el) {
				if (el.innerText.indexOf(text) != -1) {
					$(el).parent('li').addClass('active').parent('ul').removeClass('hide-opt');
					return false;
				}
			});
		}

		$('#logout').on('click', function (e) {
           $.post('/admin/logout', function (data) {
               if (data.status) {
                   alert('注销成功！');
                   location.href = '/admin/login'
               }
           });
        });
	</script>
	